using System.Data.Odbc;
using Chaotic.DataBase.DataAccess; 

namespace Chaotic.DataBase.ODBCAccess;

public class DbTypeEnum : IDbTypeEnum
{
	public int GetTypeEnum(string? dbType)
	{
		return dbType.Trim().ToUpper() switch
		{
			"BIT" => OdbcType.BigInt.GetHashCode(), 
			"BINARY" => OdbcType.Binary.GetHashCode(), 
			"BIGINT" => OdbcType.BigInt.GetHashCode(), 
			"CHAR" => OdbcType.Char.GetHashCode(), 
			"DATETIME" => OdbcType.DateTime.GetHashCode(), 
			"DECIMAL" => OdbcType.Decimal.GetHashCode(), 
			"FLOAT" => OdbcType.Double.GetHashCode(), 
			"INT" => OdbcType.Int.GetHashCode(), 
			"IMAGE" => OdbcType.Image.GetHashCode(), 
			"MONEY" => OdbcType.Decimal.GetHashCode(), 
			"TEXT" => OdbcType.Text.GetHashCode(), 
			"TIMESTAMP" => OdbcType.Timestamp.GetHashCode(), 
			"VARCHAR" => OdbcType.VarChar.GetHashCode(), 
			_ => 0, 
		};
	}
}
